package LeetCode.month03.day87;

/**
 * @author 16778
 * @date 2025/10/27 8:13
 * @description
 */
public class No2125 {
    public int numberOfBeams(String[] bank) {
        int n = bank.length;
        int pre = 0;
        int res = 0;
        for (int i = 0; i < n; i++) {
            int count = 0;
            for (int j = 0; j < bank[i].length(); j++) {
                if(bank[i].charAt(j)=='1'){
                    count++;
                }
            }
            if(count!=0){
                res+=pre*count;
                pre = count;
            }
        }
        return res;
    }
}
